﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hallenberg.SmartClient.Interfaces;
using Hallenberg.SmartClient.Menu;
using System.Reflection;

namespace Hallenberg.SmartClient.Test.TestObject
{
    class MenuItemAttributeExtender : IAttributeTypeHandlerExtender
    {
        public static bool HandlerHasExecuted { get; set; }

        static MenuItemAttributeExtender()
        {
            MenuItemAttributeExtender.HandlerHasExecuted = false;
        }

        public Type HandledType
        {
            get
            {
                return typeof(MenuItemAttribute);
            }
        }

        public bool Handle(Type attachedToClass, MethodBase attachedToMethod, Attribute attributeInstance, Attribute[] allAttributes)
        {
            MenuItemAttributeExtender.HandlerHasExecuted = true;
            return true;
        }
    }
}
